#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

echo "🟢 Running pre-commit checks on staged files..."

# 执行 lint-staged
pnpm lint-staged
status=$?

if [ $status -ne 0 ]; then
  echo "❌ Pre-commit checks failed. Fix the errors above before committing."
  exit $status
fi

echo "✅ Pre-commit checks passed. Proceeding with commit."
